var dota_app = angular.module('dotaApp', []);

dota_app.controller('dota_container', ['$scope', '$http', function($scope, $http) {
    $scope.person = 'Purk';
    $http({ method: 'get', url: '/video' }).
    then(function(response) {
        $scope.videos = response.data.data
    }, function(response) {

    });
}])

dota_app.controller('dota_catch', ['$scope', '$http', function($scope, $http) {
    $scope.catch = function() {
        $http({ method: 'get', url: '/catch' }).
        then(function(response) {
            if (response.data.code = 50000) {
                alert("抓取完成");
            } else {
                alert("抓取失败");
            }
        }, function(response) {

        });
    }
}])
